package org.wd.extractor.model;

import java.sql.Time;

/**
 * Represents one of the stations for a route.
 */
public class RouteStation extends Station implements Comparable<Integer> {

	/**
	 * Index representing the order of this station in the route. Index of the
	 * source is 1.
	 */
	private Integer stationIndex;

	/**
	 * Arrival time at this station (24 hour format). <code>null</code> for the
	 * origin.
	 */
	private Time arrival;

	/**
	 * Departure time from this station (24 hour format). <code>null</code> for
	 * the destination.
	 */
	private Time departure;

	/**
	 * Distance (in kilometers) from origin.
	 */
	private int distance;

	/**
	 * The day of arrival relative to the beginning of the trip. A value of 1
	 * represents that the train reaches this station on the same day.
	 */
	private int day;

	/**
	 * 
	 */
	private int routeNumber;

	public Integer getStationIndex() {
		return stationIndex;
	}

	public void setStationIndex(Integer stationIndex) {
		this.stationIndex = stationIndex;
	}

	public Time getArrival() {
		return arrival;
	}

	public void setArrival(String arrival) {
		this.arrival = Time.valueOf(arrival + ":00");
	}

	public Time getDeparture() {
		return departure;
	}

	public void setDeparture(String departure) {
		this.departure = Time.valueOf(departure + ":00");
	}

	public int getDistance() {
		return distance;
	}

	public void setDistance(int distance) {
		this.distance = distance;
	}

	public int getDay() {
		return day;
	}

	public void setDay(int day) {
		this.day = day;
	}

	public int getRouteNumber() {
		return routeNumber;
	}

	public void setRouteNumber(int routeNumber) {
		this.routeNumber = routeNumber;
	}

	// @Override
	// public int compareTo(Integer index) {
	// return stationIndex.compareTo(index);
	// }

	public int compareTo(Integer index) {
		return stationIndex.compareTo(index);
	}

}
